<template>
    <!-- 面包屑组件 -->
  <div class='xtx-bread'>
    <div class="xtx-bread-item">
        <!-- 一级 -->
      <RouterLink to="/">首页</RouterLink>
    </div>
    <i class="iconfont icon-angle-right"></i>
    <!-- 二级  判断是否有数据 -->

<template  :v-show="Name">
  <Transition name="fade-right" mode="out-in">
   <div class="xtx-bread-item">
    <RouterLink v-if="Name1" :to="Path">{{Name}}</RouterLink>
    <span v-else>{{Name}}</span>
   </div>
  </Transition>
    <i v-if="Name1" class="iconfont icon-angle-right"></i>
</template>

    <!-- 三级  判断是否有数据 -->
  <template v-if="Name1">
  <Transition name="fade-right" mode="out-in">
   <div class="xtx-bread-item">
    <RouterLink v-if="Name2" :to="Path">{{Name1}}</RouterLink>
    <span v-else>{{Name1}}</span>
   </div>
  </Transition>
    <i v-if="Name2" class="iconfont icon-angle-right"></i>
 </template>
   </div>
</template>

<script>
import { ref, watch } from 'vue'
export default {
  name: 'XTXMianBaoxie',
  props: {
    // 二级
    Name: {
      type: String,
      default: ''
    },
    Path: {
      type: String,
      default: ''
    },
    // 三级
    Name1: {
      type: String,
      default: ''
    },
    path1: {
      type: String,
      default: ''
    },
    // 四级
    Name2: {
      type: String,
      default: ''
    },
    path2: {
      type: String,
      default: ''
    }
  },
  setup (props) {
    watch(() => props, (newVal) => {
    }, { immediate: true })
    const Props = ref([])
    Props.value = props
  }
}
</script>

<style scoped lang='less'>
.xtx-bread{
  display: flex;
  padding: 25px 10px;
  &-item {
    a {
      color: #666;
      transition: all .4s;
      &:hover {
        color: @xtxColor;
      }
    }
  }
  i {
    font-size: 12px;
    margin-left: 5px;
    margin-right: 5px;
    line-height: 22px;
  }
}
</style>
